﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProductsInGrid.ascx.cs" Inherits="CS424_9pts.Templates.Categories.ProductsInGrid" %>
<%@ Register src="../../Modules/ProductBox1.ascx" tagname="ProductBox1" tagprefix="uc" %>
<div class="category-page">
    <%--  <% if (this.SettingManager.GetSettingValueBoolean("Media.CategoryBreadcrumbEnabled"))
       { %>
    <div class="breadcrumb">
        <a href='<%=CommonHelper.GetStoreLocation()%>'>
            <%=GetLocaleResourceString("Breadcrumb.Top")%></a> /
        <asp:Repeater ID="rptrCategoryBreadcrumb" runat="server">
            <ItemTemplate>
                <a href='<%#SEOHelper.GetCategoryUrl(Convert.ToInt32(Eval("CategoryId"))) %>'>
                    <%#Server.HtmlEncode(Eval("LocalizedName").ToString())%></a>
            </ItemTemplate>
            <SeparatorTemplate>
                /
            </SeparatorTemplate>
        </asp:Repeater>
        <br />
    </div>
    <div class="clear">
    </div>
    <% } %>--%>
    <div class="category-description">
        <asp:Literal runat="server" ID="lDescription"></asp:Literal>
    </div>
    <div class="clear">
    </div>
    <div class="sub-category-grid">
        <asp:DataList ID="dlSubCategories" runat="server" RepeatColumns="3" RepeatDirection="Horizontal"
            RepeatLayout="Table" ItemStyle-CssClass="item-box">
            <ItemTemplate>
                <div class="sub-category-item">
                    <h2 class="category-title">
                        <asp:HyperLink ID="hlCategory" runat="server" />
                    </h2>
                    <div class="picture">
                        <asp:HyperLink ID="hlImageLink" runat="server" />
                    </div>
                </div>
            </ItemTemplate>
        </asp:DataList>
    </div>
    <div class="clear">
    </div>
    <asp:Panel runat="server" ID="pnlFeaturedProducts" class="featured-product-grid">
        <div class="title">
           "FeaturedProducts"
        </div>
        <div>
            <asp:DataList ID="dlFeaturedProducts" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
                RepeatLayout="Table" ItemStyle-CssClass="item-box">
                <ItemTemplate>
                 <uc:ProductBox1 ID="ctrlProductBox" Product=""
                        runat="server" />
                </ItemTemplate>
            </asp:DataList>
        </div>
    </asp:Panel>
    <div class="clear">
    </div>
  
    <div class="clear">
    </div>
    <div class="product-grid">
        <asp:DataList ID="dlProducts" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"
            RepeatLayout="Table" ItemStyle-CssClass="item-box">
            <ItemTemplate>
               <div class="product-item">
    <h2 class="product-title">
        <asp:HyperLink ID="hlProduct" runat="server" Text='<%#Eval("ModelName") %>' NavigateUrl="#" />
    </h2>
    <div class="picture">
        <asp:HyperLink ID="hlImageLink" runat="server" />
    </div>
    <div class="description">
        <asp:Literal runat="server" ID="lShortDescription" Text='<%#Eval("Description") %>'></asp:Literal>
    </div>
    <div class="add-info">
        <div class="prices">
            <asp:Label ID="lblOldPrice" runat="server" CssClass="oldproductPrice" Text='<%#("Price") %>' />
            <br />
            <asp:Label ID="lblPrice" runat="server" CssClass="productPrice" Text='<%#("Price") %>'/>
        </div>
        <div class="buttons">
            <asp:Button runat="server" ID="btnProductDetails"
                Text="Product Detail" ValidationGroup="ProductDetails"
                CssClass="productgridproductdetailbutton" /><br />
            <asp:Button runat="server" ID="btnAddToCart" Text="Add To Cart"
                ValidationGroup="ProductDetails" CssClass="productgridaddtocartbutton" />
        </div>
    </div>
</div>
            </ItemTemplate>
        </asp:DataList>
    </div>
    <div class="clear">
    </div>
    <div class="product-pager">
        <%--<uc:Pager runat="server" ID="productsPager" FirstButtonText="First"
            LastButtonText="Last" NextButtonText="Next"
            PreviousButtonText="Previous" CurrentPageText="Pager.CurrentPage" />--%>
    </div>
</div>
<asp:SqlDataSource ID="CarCategory" runat="server" 
    ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>" 
    
    SelectCommand="SELECT CarModel.ModelID, CarModel.BrandID, CarModel.Engine, CarModel.Fuel, CarModel.Brake, CarModel.Transmission, CarModel.SpectableID, CarModel.Price as Price, CarModel.ModelName as ModelName, CarModel.ImageName, CarModelDetail.Description as Description FROM CarModel INNER JOIN CarModelDetail ON CarModel.ModelID = CarModelDetail.ModelID WHERE (CarModel.BrandID = @BrandID)">
    <SelectParameters>
        <asp:QueryStringParameter Name="BrandID" QueryStringField="@BrandID" 
            Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>